#include "Player.h"

Player::Player()
{

}

Player::~Player()
{
	for (std::vector<Piece*>::iterator it = m_pieces.begin() ; it != m_pieces.end(); ++it)
	{
		delete[] *it;
	}
	m_pieces.clear();
}

int Player::getNumber()
{
	return m_playerNum;
}

void Player::setNumber(int n)
{
	m_playerNum = n;
}

std::vector<Piece*>& Player::getPieces()
{
	//Piece *n = new Piece[16];
	return m_pieces;
}

void Player::setPieces(std::vector<Piece*>& nPieces)
{
	m_pieces = nPieces;
}

int Player::getNumPieces()
{
	return m_pieces.size();
}

void Player::delPiece(int num)
{
	m_pieces.erase(m_pieces.begin()+num);
}

void Player::addPiece(char symbol, int xPos, int yPos)
{
	Piece* temp = new Piece( symbol, xPos, yPos);
	m_pieces.push_back(temp);
}